package com.zhoug.zmuidemo.ui;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import com.zhoug.common.utils.LogUtils;
import com.zhoug.common.utils.ToastUtils;
import com.zhoug.zmui.ZMUISideBar;
import com.zhoug.zmuidemo.R;

public class SideBarActivity extends AppCompatActivity {
    private static final String TAG = ">>>SideBarActivity";
    private RecyclerView mRecyclerView;
    private ZMUISideBar mSideBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_side_bar);
        findViews();
        mSideBar.setOnTouchingLetterChangedListener(new ZMUISideBar.OnTouchingLetterChangedListener() {
            @Override
            public void onTouchingLetterChanged(String letter) {
                LogUtils.d(TAG, "onTouchingLetterChanged:letter="+letter);
                ToastUtils.toastShortCenter(getApplicationContext(),letter);
            }
        });
    }

    private void findViews() {
        mRecyclerView = findViewById(R.id.recyclerView);
        mSideBar = findViewById(R.id.sideBar);
    }
}